<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>模块</title>
<%@include file="../public.jsp"%>
<script src="<%=path %>/js/module/module.js"></script>
</head>
<body>
	
	<%@include file="../head.jsp"%>
	<%@include file="../project/menu.jsp"%>
	<input type="hidden" id="proId_module" value="${proId}">
	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="<%=path %>/index"><span
						class="glyphicon glyphicon-home"></span></a></li>
				<li><a href="<%=path %>/project">项目列表</a></li>
				<li class="active">${project.name}</li>
			</ol>
		</div>
		<!--/.row-->
	</div>
	<!--/.main-->
	<br>
	<br>
	<br>
	<br>
	<div class="container">
		<div class="col-lg-6">
			<div class="input-group"
				style="position: absolute; margin-left: 200px;">
				<input type="text" class="form-control" id="condition_module"
					name="condition" value="${condition}"> <span
					class="input-group-btn"> <a class="btn btn-primary"
					id="searchModule">搜索</a>
				</span>
			</div>
		</div>
		<!-- end -->

		<!-- 添加模块的按钮 -->
		<button class="btn btn-success" type="button" data-toggle="modal"
			data-target="#addModuleModal"
			style="position: absolute; margin-left: 515px">新增</button>
		<!-- end -->

		<!-- 添加模块弹窗 -->
		<div class="modal fade" id="addModuleModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog" style="width: 700px; height: 500px;">
				<form role="form" action="<%=path %>/project/${proId}/module/save"
					id="moduleForm" method="post">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel" align="center">
								创建模块</h4>
						</div>
						<div class="modal-body"
							style="overflow-y: auto; width: 697px; height: 260px;">

							<dl class="dl-horizontal" style="float: left;">
								<dt>模块名称</dt>
								<dd>
									<div style="width: 350px;">
										<input type="text" class="form-control" id="module_name"
											name="name" required="required" onblur="checkName(module_name)"
											placeholder="请输入模块名称"><span id="module_name1"
											style="color: red;"></span><br>
									</div>
								</dd>
	
								<dt>
									<label for="name">排序权重</label>
								</dt>
								<dd>
									<input type="text" class="form-control" name="sort" id="module_sort"
										required="required" placeholder="请输入数字"
										onblur="checkSort(api_sort)"><br>
								</dd>

								<dt>
									<label for="name">描述信息</label>
								</dt>
								<dd>
									<textarea class="form-control" rows="4" name="description"
										required="required" placeholder="介绍一下你创建的模块"></textarea>
								</dd>

							</dl>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</form>
			</div>
			<!-- /.modal -->
		</div>
		<!-- end -->

		<!-- 更新module弹窗 -->
		<div class="modal fade" id="updateModuleModal" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog" style="width: 700px; height: 500px;">
				<form role="form" action="<%=path %>/project/${proId}/module/update"
					id="moduleForm" method="post">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModuleModalLabel" align="center">
								更新模块</h4>
						</div>
						<div class="modal-body"
							style="overflow-y: auto; width: 697px; height: 260px;">
							<input type="hidden" id="moduleId" name="id" value="">

							<dl class="dl-horizontal" style="float: left;">

								<dt>
									<label for="name">模块名称</label>
								</dt>
								<dd>
									<div style="width: 350px;">
										<input type="text" class="form-control" id="moduleName" name="name"
											required="required"><br>
									</div>
								</dd>
								<dt>
									<label for="name">排序权重</label>
								</dt>
								<dd>
									<input type="text" class="form-control" id="moduleSort" name="sort"
										required="required"><br>
								</dd>

								<dt>
									<label for="name">描述信息</label><br>
								</dt>
								<dd>
									<textarea class="form-control" rows="4" id="moduleDescription"
										name="description" required="required"></textarea>
								</dd>

							</dl>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</form>
			</div>
			<!-- /.modal -->
		</div>
		<!-- end -->

		<br>
		<br>
		<br>

		<!-- 表格 -->
		<div class="ApiList1" style="position: static; margin-left: 217px">
			<table class="table table-bordered" style="width: 100%;">
				<thead>
					<tr>
						<th style="width: 6%">#</th>
						<th style="width: 15%">名称</th>
						<th style="width: 16%">描述</th>
						<th style="width: 16%">权重</th>
						<th style="width: 17%">创建时间</th>
						<th style="width: 12%">操作</th>
					</tr>
				</thead>
				<tbody id="moduleList">

				</tbody>
			</table>
			<!-- end -->
			<div id="pagination"></div>
		</div>
	</div>
</body>
</html>